package com.common.code.config;
/**
 * 有人觉得swagger的界面太丑了
 * 所以就加了这个配置 利用了bootstrap前端框架的ui界面 需要在pom.xml 添加依赖
 * 访问地址：http://localhost:8080/swagger-ui.html       swagger界面
 *           http://localhost:8080/doc.html              bootstrap界面
 */

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 解决 swagger-ui.html 404报错
        registry.addResourceHandler("/swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
        // 解决 doc.html 404 报错
        registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/");
    }
}
